package com.smbms.mapper;

import com.smbms.entity.Permissions;
import com.smbms.entity.SmbmsRole;
import java.util.List;

import org.apache.ibatis.annotations.Param;

public interface SmbmsRoleMapper {
    int deleteByPrimaryKey(Long id);

    int insert(SmbmsRole record);

    SmbmsRole selectByPrimaryKey(Long id);

    List<SmbmsRole> selectAll();

    int updateByPrimaryKey(SmbmsRole record);
    
    //获取所有包括一级二级 zTree
    List<Permissions> selectRolePermissions(@Param("id") Long id);
    
    //通过关联关系获取
    List<Permissions> selectPermissionsByRoleId(@Param("pid")Long pid ,@Param("id") Long id);
    
    int deletePermissByRoleId(Long id);
    
    int addRolePermiss(@Param("roleId") Long roleId,@Param("permIds") Long [] permIds);
}